<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("utf-8");%>
<% response.setContentType("text/html;charset=utf-8");%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>用户注册</title>
        <link href="CSS/style1.css" rel="stylesheet">
        <script language="javascript">
            function check(){
                if (myform.mc.value==""){
                    alert("请输入用户名！");myform.mc.focus();return;
                }

                if (myform.mm.value==""){
                    alert("请输入密码！");myform.mm.focus();return;
                }
                if (myform.mm.value.length<1){
                    alert("密码至少为6位，请重新输入！");myform.mm.focus();return;
                }
                if (myform.PWD2.value==""){
                    alert("请确认密码！");myform.PWD2.focus();return;
                }
                if (myform.mm.value!=myform.PWD2.value){
                    alert("您两次输入的密码不一致，请重新输入！");myform.PWD1.focus();return;
                }
                myform.submit();
            }
        </script>
    </head>
    <body>
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <table width="750" height="768"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                        <tr>
                            <td valign="top">
                                <jsp:include page="banner.jsp"/>
                                <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="tableBorder_LTR">
                                    <tr>
                                        <td height="30" align="center" bgcolor="#00FF33">≡≡≡ 用户注册信息 ≡≡≡</td>
                                    </tr>
                                </table>
                                <table width="100%" height="330"  border="0" cellpadding="0" cellspacing="0" class="tableBorder_LBR">
                                    <tr>
                                        <td width="26%" valign="top"><table width="100%"  border="0" cellspacing="-2" cellpadding="-2">
                                                <tr>
                                                    <td width="55%" height="82" align="center" class="word_grey">&nbsp;<img src="Images/reg.gif" width="84" height="54"></td>
                                                    <td width="45%" align="left" class="word_grey"><b>注册帮助</b></td>
                                                </tr>
                                                <tr>
                                                    <td height="112" colspan="2" valign="top" class="word_grey"><ul>
                                                            <li> 用户名：为用户进行订单查询的通行证号，可使用英文字母、数字或英文字母、数字、下划线的组合，长度控制在3-20个字符之内。</li>
                                                            <li>真实姓名： 请输入真实的姓名，以便于我们与您联系。该项为隐藏项，用户可以放心输入。</li>
                                                            <li>密码：请设定在6-20位之间，用户密码及确认密码必须一致。</li>
                                                            <li>证件号码：请输入正确的证件号码。</li>
                                                            <li>Email：请填写有效的Email地址，以便于与您联系。</li>
                                                    </ul></td>
                                                </tr>
                                                <tr align="center">
                                                    <td colspan="2" valign="middle" class="word_grey"></td>
                                                </tr>
                                        </table></td>
                                        <td width="5" valign="top" background="Images/Cen_separate.gif"></td>
                                        <td width="73%" valign="top"><table width="100%" height="56"  border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td align="center">&nbsp;</td>
                                                </tr>
                                                <tr>
                                                    <td align="center">
                                                        <form action="register.jsp" method="post" name="myform">
                                                            <table width="100%"  border="0" cellspacing="-2" cellpadding="-2">
                                                                <tr>
                                                                    <td width="18%" height="30" align="center">用 户 名：</td>
                                                                    <td width="82%" class="word_grey"><input name="mc" type="text" id="UserName4" maxlength="20" value="">
                                                                    * </td>
                                                                </tr>
                                                                <tr>
                                                                    <td height="28" align="center">密&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
                                                                    <td height="28"><input name="mm" type="password" id="PWD14" size="20" maxlength="20">
                                                                    *</td>
                                                                </tr><input type="hidden" name="submited" value="true" />
                                                                <tr>
                                                                    <td height="28" align="center">确认密码：</td>
                                                                    <td height="28"><input name="PWD2" type="password" id="PWD25" size="20" maxlength="20">
                                                                    * </td>
                                                                </tr>
                                                                <tr>
                                                                    <td height="34">&nbsp;</td>
                                                                    <td class="word_grey"><input name="Button" type="button" class="btn_grey" value="确定保存"onClick="check()">
                                                                        <input name="Submit2" type="reset" class="btn_grey" value="重新填写">
                                                                    <input name="Submit22" type="button" class="btn_grey" value="返回" onClick="window.location.href='bookstore.jsp'"> </td>
                                                                </tr>
                                                            </table>
                                                        </form>
                                                    </td>
                                                </tr>
                                        </table></td>
                                    </tr>
                                </table>
                                <jsp:include page="copyright.jsp"/>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <jsp:useBean id="user" scope="session" class="bis.FLCustomer" />
        <c:if test="${param.submited!=null}">
            <jsp:setProperty name="user" property="*"/>
            <c:choose>
                <c:when test="${user.insert!=true}">
                    <c:out value="<script language='javascript'>alert('该用户名已经存在，请重新注册！');window.location.href='register.jsp';</script>" escapeXml="false" > </c:out>

                </c:when>
                <c:otherwise>
                    <c:out value="<script language='javascript'>alert('注册成功');window.location.href='register.jsp';</script>" escapeXml="false" > </c:out>

                </c:otherwise>
            </c:choose>


        </c:if>
    </body>
</html>
